package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.EmployeeLoginDTO;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.entity.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     *
     * @param username
     * @return
     */
    Employee getByUsername(String username);


    /**
     * 新增员工
     * @param employee
     */

    void insert(Employee employee);

    /**
     * 员工分页查询
     * @param dto
     * @return
     */
    Page<Employee> pageQuery(EmployeePageQueryDTO dto);

    /**
     * 启用禁用员工
     * @param employee
     */
    void status(Employee employee);

    /**
     * 查询员工
     * @param id
     * @return
     */
    @Select("select * from employee where id = #{id}")
    Employee getById(Long id);

}
